package org.edu.modules.kwgl.service.impl;

import org.edu.modules.kwgl.entity.VeJwQingkao;
import org.edu.modules.kwgl.mapper.VeJwQingkaoMapper;
import org.edu.modules.kwgl.service.IVeJwQingkaoService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @Description: ve_jw_qingkao
 * @Author: jeecg-boot
 * @Date:   2021-05-08
 * @Version: V1.0
 */
@Service
public class VeJwQingkaoServiceImpl extends ServiceImpl<VeJwQingkaoMapper, VeJwQingkao> implements IVeJwQingkaoService {

    @Override
    public void changePublishById(int id, int status) {
        baseMapper.updateById(new VeJwQingkao().setId(id).setIspublish(status));
    }

    @Override
    public void updateStatusByIds(String ids, int status) {
        List<String> list = Arrays.asList(ids.split(","));
        for (String str:list) {
            baseMapper.updateById(new VeJwQingkao().setId(Integer.parseInt(str)).setStatus(status));
        }
    }

}
